//
//  NearGroup.m
//  SportSocial
//
//  Created by yull on 15/1/3.
//  Copyright (c) 2015年 yull. All rights reserved.
//

#import "NearGroup.h"

@implementation NearGroup

+ (instancetype)nearGroupWithDict:(NSDictionary *)dict
{
     NearGroup *nearGroup = [[NearGroup alloc] init];
    
    for (NSString *key in dict.allKeys) {
        id value = [dict objectForKey:key];
        if ([value isKindOfClass:[NSNull class]]) {
            value = @"";
        }
        [nearGroup setValue:value forKey:key];
    }
    return nearGroup;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        [self setValue:value forKey:@"group_id"];
    }else {
        NSLog(@"near group undefined key=%@",key);
    }
}
@end
